program example
use polymorphic_complextaylor
implicit none 
integer no,nv,i
type(real_8) f,g


no=4; nv= 2;  ! no: the order of the polynomial    nv: the number of variables
call init(no,nv)  ! initializes taylor series without maps

call alloc(f,g)      ! must be constructed after init

i=3
f=(2.d0.mono.'11') + (3.d0.mono.'21') + (4.d0.mono.'04') + 5.d0  
  !  Creates 2.d0 x_1 x_ 2 + 3.d0x_1^2x_2 + 4.d0x_2^4 + 5.d0
g=f.cut.i        !  Creates 2.d0 x_1 x_2 + 5.d0
call print(f,6)
call print(g,6)


!  If f is real and i>=1, cutorder should return 6.d0 
i=3
f=6.d0
g=f.cut.i        !  Creates 
call print(f,6)
call print(g,6)


call kill(f,g)      ! must be destroyed
end program example